/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.trainning.giangnd.btvn2;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author GIANG
 */
public class B6 {
    public static String chuanhoa(String a){
        int i=0;
        String b="";
        for(i=0;i<a.length();i++)
            if(a.charAt(i)!=32){
                {
                    b+=a.charAt(i);
                    b=b.toLowerCase();
                }
                if(a.charAt(i+1)==32)
                    b+=' ';
        }
        b=b.toLowerCase();
        return b;
    }
    public static void main(String[] args) throws FileNotFoundException, IOException {
        BufferedReader br=new BufferedReader(new FileReader("Data/B6.txt"));
        BufferedWriter bf=new BufferedWriter(new FileWriter("Data/B6OUT.txt"));
        String a = null;
        while(br.ready()==true){
            a=br.readLine();
        }
        System.out.println(chuanhoa(a));
        bf.write(chuanhoa(a));
        bf.close();
    }
    
}
